package de.szut.tictactoe.gui;

import javax.swing.JFrame;



import de.szut.tictactoe.main.UserInterface;

@SuppressWarnings("serial")
public class MainFrame extends JFrame implements UserInterface{

	private GamePanel contentPane;

	private static MainFrame frame;
	
	public static MainFrame getInstance(){
		if (frame == null) {
			frame = new MainFrame();
			frame.generateGamePanel();
		}
		return frame;
	}
	
	/**
	 * Create the frame.
	 */
	private MainFrame() {
		setTitle("Tic Tac Toe");
		setResizable(false);
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setBounds(100, 100, 450, 300);
		setVisible(true);
	}
	
	private void generateGamePanel() {
		contentPane = new GamePanel();
		setContentPane(contentPane);
		this.revalidate();
		this.repaint();
	}
}
